<%--
  User: LiXiaobo  Date: 2020/12/2 Time: 上午10:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>用户管理</title>
    <base href="<%=request.getContextPath()%>/"/>
    <link rel="stylesheet" href="webjars/layui/2.5.5/css/layui.css">
</head>
<body>

<div class="layui-container">
    <script type="text/html" id="toolbar">
        <div class="layui-btn-container">
            <button class="layui-btn layui-btn-sm" lay-event="add" onclick="add()">添加用户</button>
            <button class="layui-btn layui-btn-sm" lay-event="grant">用户授权</button>
        </div>
    </script>
    <table id="userTb" lay-filter="userTb"></table>
</div>

<script src="webjars/layui/2.5.5/layui.js"></script>
<script>
    //表格初始化
    layui.use(["table"],function() {
        let table = layui.table;
        table.render({
            id: "userTb",
            elem: "#userTb",
            url: "sys/user/search",
            toolbar: "#toolbar",
            page: { limit:5, limits:[5,10,15]},
            cols: [[
                {title: "角色代号", field: "userCode"},
                {title: "角色名称", field: "username"},
                {title:"电话",field: "phone"},
                {title:"角色",field:"userRole"},
                {title: "创建时间", field: "creationDate"},
                {title: "操作", toolbar: "#action"}
            ]]
        });
    })

</script>
</body>
</html>
